package com.java1412.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author java1412
 * @since 2023-02-20 11:50
 */
// 作为feign的客户端
// value的值是服务注册中心的中服务提供的应用名
// fallback：指定降级处理的类
@FeignClient(value = "SERVICE-HI", fallback = SchedualServiceHiHystrix.class)
public interface SchedualServiceHi {
    // 定义请求的方法
    @RequestMapping(value = "/hi", method = RequestMethod.GET)
    public String sayHiFromClientOne(@RequestParam(value = "userName", required = false, defaultValue = "admin") String userName);
}
